package com.liyujie.dyeingmachine.common;

import android.os.Environment;

import java.io.File;

public class Constants {
    // 头
    public static final byte COMMAND_DATA_HEAD = 0x15;
    // 联机
    public static final byte COMMAND_CMD_CODE_ONLINE = 0x01;
    // 联机测试
    public static final byte COMMAND_CMD_CODE_ONLINE_TEST = 0x02;
    // X轴电机检测
    public static final byte COMMAND_CMD_CODE_ONLINE_X = 0x03;
    // Y轴电机检测
    public static final byte COMMAND_CMD_CODE_ONLINE_Y = 0x04;
    // 打印机检测
    public static final byte COMMAND_CMD_CODE_PRINT_TEST = 0x05;
    // 通道检测
    public static final byte COMMAND_CMD_CODE_PORT_TEST = 0x06;
    // LED检测
    public static final byte COMMAND_CMD_CODE_LED_TEST = 0x07;
    // 温度检测
    public static final byte COMMAND_CMD_CODE_TEMPERATURE_TEST = 0x08;
    // 通道状态命令
    public static final byte COMMAND_CMD_CODE_ONLINE_PORT = 0x09;
    // 采样数据上传
    public static final byte COMMAND_CMD_CODE_DATA_RECEIVE = 0x0A;
    // 打印
    public static final byte COMMAND_CMD_CODE_PRINT = 0x0B;
    // 设置1通道位置
    public static final byte COMMAND_CMD_SET_PORT_1 = 0x0C;
    // 设置采样起始位置
    public static final byte COMMAND_CMD_SET_START_POSITION = 0x0D;
    // 设置通道间隔
    public static final byte COMMAND_CMD_SET_PORT_INTERVAL = 0x0E;
    // 设置测试延迟时间
    public static final byte COMMAND_CMD_SET_DELAY_TIME = 0x0F;
    // 设置增益
    public static final byte COMMAND_CMD_SET_GAIN = 0x11;
    // 1.1.4 新整扫描无效，二维码未准备识别，下位机报告
    public static final byte COMMAND_CMD_NO_QRCODE = 0x12;
    // 设置温度
    public static final byte COMMAND_CMD_WORK_TEMPERATURE = 0x10;
    // 尾
    public static final byte COMMAND_DATA_END = 0x16;

    /**
     * 通道状态
     * 00 空闲 01 检测 02 完毕
     */
    public static final byte PORT_STATE_FREE = 0x00;
    public static final byte PORT_STATE_WORK = 0x01;
    public static final byte PORT_STATE_OVER = 0x02;

    /**
     * 延迟时间
     */
    public static final byte DELAY_IMMEDIATELY = 0x00;
    public static final byte DELAY_ONE = 0x01;
    public static final byte DELAY_TWO = 0x02;
    public static final byte DELAY_THREE = 0x03;
    public static final byte DELAY_FOUR = 0x04;
    public static final byte DELAY_FIVE = 0x05;
    public static final byte DELAY_SIX = 0x06;
    public static final byte DELAY_SEVEN = 0x07;
    public static final byte DELAY_EIGHT = 0x08;
    public static final byte DELAY_NINE = 0x09;
    public static final byte DELAY_TEN = 0x0A;

    /**
     *  无数据内容 或 下位机返回验证
     *  联机 联机测试 X轴 Y轴 打印机 LED检测 通道状态 采样数据 打印命令
     */
    public static final byte COMMAND_DATA_NULL = 0x00;

    /**
     * 1.1.4 新整温度调整
     */
    public static final String SP_WORK_TEMPERATURE = "work_temperature";
    /**
     * 自动打印
     */
    public static final String SP_AUTO_PRINT = "auto_print";
    /**
     * 自动上传
     */
    public static final String SP_AUTO_UPLOAD = "auto_upload";
    /**
     * v1.1.12SP_AUTO_SEARCH_PEAKS
     * 0 自动
     * 1 手动
     * 2 扫码枪
     */
    public static final String SP_SP_ID_MODEL = "sp_id_model";
    /**
     * 延迟时间设置 V1.0.1新增功能
     */
    public static final String SP_SET_DELAY_TIME = "delay_time";
    /**
     * 创谱设备序列号
     */
    public static final String SP_DEVICE_ID = "device_id";
    /**
     * 单位名称
     */
    public static final String SP_COMPANY_NAME = "company_name";

    /**
     * 新整剩余时间,记录剩余时间的时间
     */
    public static final String SP_RESIDUE_TIME = "residue_time";
    /**
     * 1.1.14
     * 新整下位机版本号
     */
    public static final String SP_DEVICE_VERSION = "sp_device_version";
    /**
     * 新整自动寻峰
     */
    public static final String SP_AUTO_SEARCH_PEAKS = "auto_search_peaks";
    /**
     * 校准开关
     */
    public static final String SP_ADJ_OPEN_CLOSE = "adj_open_or_close";

    // 二进制数据长度
    public static final int DATA_SIZE = 2000;

    /**
     * 通道数量
     */
    public static final String CHANNEL_QUANTITY = "channel_quantity";

    /**
     * 日志路径
     */
    public static String LogPath = Environment.getExternalStorageDirectory().getPath() + File.separator + "log" ;
}
